package com.lancoo.cvas.pojo.response.basicPlatform;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.lancoo.cvas.entity.Teacher;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName BaseTeacher
 * @Description 基础平台教师接口
 * @Author quin
 * @Date 2023/3/1 9:27
 */
@NoArgsConstructor
@Data
public class BaseTeacher {
    @JsonProperty("UserID")
    private String userID;
    @JsonProperty("ShortName")
    private String shortName;
    @JsonProperty("UserName")
    private String userName;
    @JsonProperty("GroupID")
    private String groupID;
    @JsonProperty("GroupName")
    private String groupName;
    @JsonProperty("CollegeID")
    private String collegeID;
    @JsonProperty("CollegeName")
    private String collegeName;
    @JsonProperty("SubjectIDs")
    private String subjectIDs;
    @JsonProperty("SubjectNames")
    private String subjectNames;
    @JsonProperty("TitleID")
    private String titleID;
    @JsonProperty("TitleName")
    private String titleName;
    @JsonProperty("RoleNames")
    private String roleNames;
    @JsonProperty("SchoolID")
    private String schoolID;
    @JsonProperty("SchoolName")
    private String schoolName;
    @JsonProperty("UserClass")
    private String userClass;
    @JsonProperty("Gender")
    private String gender;
    @JsonProperty("PhotoPath")
    private String photoPath;
    @JsonProperty("AvatarPath")
    private String avatarPath;
    @JsonProperty("Telephone")
    private String telephone;
    @JsonProperty("Telephone2")
    private String telephone2;
    @JsonProperty("QQ")
    private String qq;
    @JsonProperty("Weibo")
    private String weibo;
    @JsonProperty("Weixin")
    private String weixin;
    @JsonProperty("Sign")
    private String sign;
    @JsonProperty("Email")
    private String email;
    @JsonProperty("UpdateTime")
    private String updateTime;
    @JsonProperty("IDCardNoSec")
    private String iDCardNoSec;
    @JsonProperty("IsMainGanger")
    private Integer isMainGanger;

    public Teacher toTeacher(Integer taskId, String schoolId, String term){
        return new Teacher()
                .setBaseTeacherId(getUserID())
                .setTeacherName(getUserName())
                .setImageUrl(getAvatarPath())
                .setSex(getGender())
                .setGroupId(getGroupID())
                .setGroupName(getGroupName())
                .setProfessionalTitle(getTitleName())
                .setSchoolId(schoolId)
                .setTerm(term)
                .setIsEnable(1)
                .setTaskId(taskId)
                .setDeleted(0);
    }
}
